package cn.tedu.csmall.order.webapi.mapper;

import cn.tedu.csmall.commons.pojo.order.entity.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface OrderMapper {

    //新增订单的mapper方法
    @Insert("insert into order_tbl(user_id,commodity_code,count,money) values" +
            "(#{userId},#{commodityCode},#{count},#{money})")
     void insert(Order order);

    //删除订单的mapper方法
    @Delete("delete from order_tbl where user_id =#{userId} and commodity_code=#{commodityCode}")
    void delete(@Param("userId") String userId,@Param("commodityCode") String commodityCode);


}
